package org.jeecg.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.common.api.vo.Result;
import org.jeecg.entity.charge.*;
import org.jeecg.entity.meter.Meter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @Description: 物业收费charge
 * @Author: liuR
 * @Date:   2021-02-07
 * @Version: V1.0
 */
@FeignClient("CIM-CHARGE")
public interface IFeignChargeService {

	//批量新增应收账单
	@RequestMapping(value = "/api/charge/bills/saveChargeBillsBatch",method = RequestMethod.POST)
	boolean saveChargeBillsBatch(@RequestParam("chargeBillsList") String chargeBillsList, @RequestHeader("tenantId") String tenantId);

	@RequestMapping(value = "/api/charge/bills/saveChargeBills",method = RequestMethod.POST)
	boolean saveChargeBills(@RequestBody ChargeBills chargeBills, @RequestHeader("tenantId") String tenantId);

	/*根据房间获取收费标准*/
	@RequestMapping(value = "/api/charge/chargeStandardList",method = RequestMethod.GET)
	Result<Page<ChargeStandard>> chargeStandardList(@RequestParam(name = "roomId") String roomId,
													 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
													 @RequestParam(name = "pageSize", defaultValue = "1") Integer pageSize,
                                                     @RequestHeader("tenantId") String tenantId);

	//蓝票
	@RequestMapping(value = "/api/charge/makeInvoiceGx/openBlue",method = RequestMethod.POST)
	Boolean openBlue(@RequestBody String req, @RequestHeader("tenantId") String tenantId);
	//红票
	@RequestMapping(value = "/api/charge/makeInvoiceGx/openRed",method = RequestMethod.POST)
	Boolean openRed(@RequestBody String req, @RequestHeader("tenantId") String tenantId);
	//是否开票
	@RequestMapping(value = "/api/charge/makeInvoiceGx/isOpenBlue",method = RequestMethod.GET)
	boolean isOpenBlue(@RequestParam("sn") String sn, @RequestHeader("tenantId") String tenantId);

	/**
	 * 生成房间下所有账单
	 * @param chargeGenerateBills
	 */
	@RequestMapping(value = "/api/charge/createChargeBills",method = RequestMethod.POST)
	void generateAllRoomBills(@RequestBody ChargeGenerateBills chargeGenerateBills, @RequestHeader("tenantId") String tenantId);

	/**
	 * 根据合同生成所有账单
	 * @param chargeGenerateBills
	 */
	@RequestMapping(value = "/api/charge/createChargeBillsContractNew",method = RequestMethod.POST)
	Result<String> createChargeBillsContractNew(@RequestBody ChargeGenerateBills chargeGenerateBills, @RequestHeader("tenantId") String tenantId);

	/**
	 * 房间未缴账单
	 * @param roomId
	 * @return
	 */
	@RequestMapping(value = "api/charge/queryRoomBills")
	List<ChargeBills> queryRoomBills(@RequestParam("roomIdList")List<String> roomId,@RequestHeader("tenantId")String tenantId,@RequestParam("spiltDate")String spiltDate);

	/**
	 * 获取单个房间所有账单
	 * @param roomId
	 * @param tenantId
	 * @return
	 */
	@RequestMapping(value = "api/charge/queryRoomAllBills")
	List<ChargeBills> queryRoomAllBills(@RequestParam("roomIdList")List<String> roomId,@RequestHeader("tenantId")String tenantId);

	/**
	 * 获取合同下所有账单
	 * @param contractId
	 * @param zjCny
	 * @param tenantId
	 * @return
	 */
	@RequestMapping(value = "api/charge/queryContractAllBills")
	List<ChargeBills> queryContractAllBills(@RequestParam("contractId")String contractId,@RequestParam("zjCny")String zjCny, @RequestHeader("tenantId")String tenantId);

	//账单作废
	@RequestMapping(value = "api/charge/batchBillDelete")
	List<ChargeBills> batchBillDelete(@RequestParam("ids")List<String> ids,@RequestHeader("tenantId")String tenantId);

	/**
	 * 合同未缴账单
	 * @param contractId
	 * @return
	 */
	@RequestMapping(value = "api/charge/queryContractBills")
	List<ChargeBills> queryContractBills(@RequestParam("contractId")String contractId,@RequestHeader("tenantId")String tenantId);

	@RequestMapping(value = "/api/charge/saveBatchFeeRoom")
	void saveBatchFeeRoom(List<ChargeFeeRuleRoom> chargeFeeRuleRoomList);
	@RequestMapping(value = "api/charge/queryRoomAllBills")
	void canCellRoomBills(@RequestParam("roomId")String roomId,@RequestHeader("tenantId")String spiltDate);
	@RequestMapping(value = "api/charge/canCellAndGenerateRoomBills")
	void canCellAndGenerateRoomBills(  List<CanGeBillsVo> genaBillsVoList, @RequestHeader("tenantId")String tenantId);

	@RequestMapping(value = "api/charge/getMaxPayBills")
	ChargeBills  getMaxPayBills(@RequestParam("roomId") String id, @RequestHeader("tenantId") String tenantId);
	@RequestMapping(value = "api/charge/canCellBills")
	void canCellBills(@RequestParam("roomIds") List<String> roomId, @RequestParam("spiltDate") String spiltDate, @RequestHeader("tenantId") String tenantId);
	@RequestMapping(value = "api/charge/canCellAllBills")
	void canCellAllBills(@RequestParam("roomIds") List<String> roomIds,@RequestHeader("tenantId") String tenantId);
}
